package com.cd.dao;

import com.cd.entity.Movie;
import com.cd.mapper.MovieMapper;
import com.cd.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.io.IOException;
import java.util.List;

public class MovieDao {

	public List<Movie> findAll() throws IOException {
		try (SqlSession session = MybatisUtil.getSqlSession(true)) {
			MovieMapper mapper = session.getMapper(MovieMapper.class);
			return mapper.findAll();
		}
	}
}